package c.e.a.b.f.b;

import android.os.Bundle;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public final class d {
    public static final d c = new d(null, null);
    public final Boolean a;
    public final Boolean b;

    public d(Boolean bool, Boolean bool2) {
        this.a = bool;
        this.b = bool2;
    }

    public static int a(Boolean bool) {
        if (bool == null) {
            return 0;
        }
        return bool.booleanValue() ? 1 : 2;
    }

    /* JADX WARNING: Removed duplicated region for block: B:12:0x0028  */
    /* JADX WARNING: Missing block: B:14:0x002e, code skipped:
            if (r9 != '1') goto L_0x0033;
     */
    public static c.e.a.b.f.b.d b(java.lang.String r9) {
        /*
        r0 = java.lang.Boolean.TRUE;
        r1 = java.lang.Boolean.FALSE;
        r2 = 0;
        if (r9 == 0) goto L_0x0036;
    L_0x0007:
        r3 = r9.length();
        r4 = 49;
        r5 = 48;
        r6 = 3;
        if (r3 < r6) goto L_0x0020;
    L_0x0012:
        r3 = 2;
        r3 = r9.charAt(r3);
        if (r3 == r5) goto L_0x001e;
    L_0x0019:
        if (r3 == r4) goto L_0x001c;
    L_0x001b:
        goto L_0x0020;
    L_0x001c:
        r3 = r0;
        goto L_0x0021;
    L_0x001e:
        r3 = r1;
        goto L_0x0021;
    L_0x0020:
        r3 = r2;
    L_0x0021:
        r7 = r9.length();
        r8 = 4;
        if (r7 < r8) goto L_0x0033;
    L_0x0028:
        r9 = r9.charAt(r6);
        if (r9 == r5) goto L_0x0031;
    L_0x002e:
        if (r9 == r4) goto L_0x0034;
    L_0x0030:
        goto L_0x0033;
    L_0x0031:
        r0 = r1;
        goto L_0x0034;
    L_0x0033:
        r0 = r2;
    L_0x0034:
        r2 = r3;
        goto L_0x0037;
    L_0x0036:
        r0 = r2;
    L_0x0037:
        r9 = new c.e.a.b.f.b.d;
        r9.m1399init(r2, r0);
        return r9;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.e.a.b.f.b.d.b(java.lang.String):c.e.a.b.f.b.d");
    }

    public static Boolean c(Boolean bool, Boolean bool2) {
        if (bool == null) {
            return bool2;
        }
        if (bool2 == null) {
            return bool;
        }
        boolean z = bool.booleanValue() && bool2.booleanValue();
        return Boolean.valueOf(z);
    }

    public static boolean e(int i, int i2) {
        return i <= i2;
    }

    public static d g(Bundle bundle) {
        if (bundle == null) {
            return c;
        }
        return new d(i(bundle.getString("ad_storage")), i(bundle.getString("analytics_storage")));
    }

    public static Boolean i(String str) {
        if (str == null) {
            return null;
        }
        if (str.equals("granted")) {
            return Boolean.TRUE;
        }
        if (str.equals("denied")) {
            return Boolean.FALSE;
        }
        return null;
    }

    public final String d() {
        StringBuilder stringBuilder = new StringBuilder("G1");
        Boolean bool = this.a;
        char c = '0';
        char c2 = bool == null ? '-' : bool.booleanValue() ? '1' : '0';
        stringBuilder.append(c2);
        bool = this.b;
        if (bool == null) {
            c = '-';
        } else if (bool.booleanValue()) {
            c = '1';
        }
        stringBuilder.append(c);
        return stringBuilder.toString();
    }

    public final boolean equals(Object obj) {
        if (!(obj instanceof d)) {
            return false;
        }
        d dVar = (d) obj;
        if (a(this.a) == a(dVar.a) && a(this.b) == a(dVar.b)) {
            return true;
        }
        return false;
    }

    public final boolean f(d dVar) {
        Boolean bool = this.a;
        Boolean bool2 = Boolean.FALSE;
        return (bool == bool2 && dVar.a != bool2) || (this.b == bool2 && dVar.b != bool2);
    }

    public final d h(d dVar) {
        return new d(c(this.a, dVar.a), c(this.b, dVar.b));
    }

    public final int hashCode() {
        return a(this.b) + ((a(this.a) + 527) * 31);
    }

    public final boolean j() {
        Boolean bool = this.a;
        return bool == null || bool.booleanValue();
    }

    public final boolean k() {
        Boolean bool = this.b;
        return bool == null || bool.booleanValue();
    }

    public final String toString() {
        StringBuilder stringBuilder = new StringBuilder("ConsentSettings: ");
        stringBuilder.append("adStorage=");
        Boolean bool = this.a;
        String str = "granted";
        String str2 = "denied";
        String str3 = "uninitialized";
        if (bool == null) {
            stringBuilder.append(str3);
        } else {
            stringBuilder.append(bool.booleanValue() ? str : str2);
        }
        stringBuilder.append(", analyticsStorage=");
        bool = this.b;
        if (bool == null) {
            stringBuilder.append(str3);
        } else {
            if (!bool.booleanValue()) {
                str = str2;
            }
            stringBuilder.append(str);
        }
        return stringBuilder.toString();
    }
}
